<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo Yii::app()->name;?> 后台管理</title>
<?php $this->renderPartial($this->header_views);?>

<script>
function view(postid){
    var url = '<?php echo $this->createUrl('view')?>?postid='+postid;	
	art.dialog.open(url,{
		id:'view',
		width:480,
		lock:true,
		fixed:true,
		title:'帖子详情'
	});
}

</script>
</head>
<body class="view_index" id="view_index_Article">
<div class="view-index-nav">
        <h3>帖子管理</h3>
  <p class="tips">
        <strong style="color:#F00">屏蔽</strong>的帖子在前台只有版主可见。
        </p>
</div>


<form class="view-index-form" style="margin:0px 20px" method="" action="<?php echo $this->createUrl('index');?>" enctype="multipart/form-data">
<table class="view-index-search mb-10" border="0" cellspacing="0" cellpadding="0" width="100%">
<input type="hidden" class="input-text" id="YII_CSRF_TOKEN" name="YII_CSRF_TOKEN" value="<?php echo Yii::app()->request->csrfToken;?>">
<input type="hidden" value="<?php echo $this->modelid;?>" name="modelid" id="modelid"/>
         
        <tr>
        <td class="search">
        <div class="div-search" style="margin:0px 0px">
        <div class="ftr">
        <button class="ui-btn ui-btn-primary mb-10" type="button" onclick="href('<?php echo $this->createUrl('Create', array('modelid'=>$this->modelid));?>')"><span class="icon-plus">+</span>添加内容</button>
        
        
        </div>
       <input placeholder="请输入关键字" class="input-keyword" value="<?php echo $search['keyword'];?>" name="keyword" id="kw" style="width:200px;"/><input id="submit_search" class="button-submit" type="submit" value="搜 索" name="submit_search" />
        <span class="view-index-batch">
        
        </span></div>
         
        </td>
        </tr>
</table>
</form>
<form class="view-index-form" method="post" action="<?php echo $this->createUrl('batch');?>" enctype="multipart/form-data">
<input type="hidden" value="<?php echo $this->modelid;?>" name="modelid" id="modelid"/>
<table class="view-index-list" style="margin-top:0" border="0" cellspacing="0" cellpadding="0" width="100%">

    <thead>
        <tr>
                        <th align="left" width="20"><input type="checkbox" class="button-checkbox" value="全选" name="chkall" id="chkall" onclick="checkAll(this, 'checked_id[]');"></th>
                        <th align="left" width="40">序号</th>
                        <?php
						
				        foreach($this->indexFields() as $k=>$val){
						
		                if ($val['field'] == 'listorder'){?>	
                        <th align="left" width="40"><?php echo $val['name']?></th>
                        <?php
						}else if ($val['field'] == 'status'){?>
                        <th align="center" width="50"><?php echo $val['name']?></th>
                        <?php
						}else{
						?>
                        <th align="left" <?php echo $this->models['setting']['index']['th'][$val['fieldid']]?>><?php echo $val['name']?></th>
                        <?php
						}
						}
						?>
                        
                        
                        
                        <th class="norightborder" width="50">操作</th>
        </tr>
    </thead>
    <tbody>
   <?php  
    foreach($rows as $k=>$v){
    ?>
    <tr>
        <td align="center"><input type="checkbox" class="button-checkbox" value="<?php echo $v['id'];?>" name="checked_id[]"/></td>
        <td><?php echo $v['id'];?></td> 
        <?php			
		foreach($this->indexFields() as $kk=>$val){
		?>
        <?php
		if ($val['field'] == 'listorder'){?>
        <td><input class="input-text input-listorder" value="<?php echo $v['listorder'];?>" name="listorder[<?php echo $v['id'];?>]"></td>
        <?php
		
		
		}else if ($val['field'] == 'status'){
		?>
        <td class="td-locked"><div onclick="change_switch(this, '<?php echo $this->createUrl('status', array('modelid'=>$this->modelid, 'field'=>'status', 'id'=>$v['id']));?>');" id="btn-locked" class="locked-<?php echo intval($v['status']);?>"></div></td> 
         <?php
		 }else if ($val['field'] == 'addtime' || $val['field'] == 'updatetime'){
		?>
        <td><?php echo date('Y-m-d', $v[$val['field']]);?></td> 
         <?php
		}else{
		?>
        <td><?php echo $this->indexFieldsValues($val, $v);?></td>
        <?php
		}
		}
		?>
        
           <td class="td-operation">
             <a href="<?php echo $this->createUrl('update',array('modelid'=>$this->modelid, 'id'=>$v['id']))?>" class="operation-update"></a>
             
             <a href="<?php echo $this->createUrl('delete',array('modelid'=>$this->modelid, 'id'=>$v['id']))?>" title="确定要删除吗？<br><br>删除后将无法恢复。" class="ml-5 operation-delete"></a>
            </td>
    </tr>
    <?php
	}
	?>
<tr style="background-color:#eee" class="batch">
<td colspan="100">
<div class="pages ftr right">
<?php $this->widget('CLinkPager',array(    
    'header'=>'',    
    'firstPageLabel' => '首页',    
    'lastPageLabel' => '末页',    
    'prevPageLabel' => '上一页',    
    'nextPageLabel' => '下一页',    
    'pages' => $pages,    
    'maxButtonCount'=>10
    )    
    );
    ?>
</div>
<input type="button" class="button-submit ml-5" value="全选" name="chkall" id="chkall" onclick="checkAll(this, 'checked_id[]');"><input type="button" class="button-submit button-reverse" value="反选" name="chkall" id="chkall" onclick="checkReverse(this, 'checked_id[]');">

<input id="batch_delete" class="button-submit ml-5" type="submit" value="批量删除" name="batch_delete" onclick="return confirm_delete('checked_id[]', this);">

<input id="submit_search" class="button-submit ml-5" type="submit" value="排序" name="batch_listorder">

</td>
</tr>  
        
        
        </tbody>
    
</table>
<input type="hidden" class="input-text" id="YII_CSRF_TOKEN" name="YII_CSRF_TOKEN" value="<?php echo Yii::app()->request->csrfToken;?>">
</form>

<script>

</script>
<?php $this->renderPartial($this->footer_views);?>
</body>
</html>